﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//1、编写程序，定义一个枚举类型，表示订单的状态值：新订单、已发货、已签收、已评价；声明一个枚举类型表示某个订单的状态并将其值输出。
namespace ConsoleApp5
{

    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = new int[10];
            for (int i = 0; i < arr.Length; i++)
            {
                Console.WriteLine("请输入第" + (i + 1) + "个数");
                arr[i] = int.Parse(Console.ReadLine());
            }
            for (int i = 0; i < arr.Length; i++)
            {
                Console.Write(arr[i] + " ");
            }
            int max;
            int min;
            int sum;
            int avg;
            Out(out max, out min, out sum, out avg, arr);

            int max1 = arr[0];
            int min1 = arr[0];
            int sum1 = 0;
            int avg1 = sum1 / arr.Length;
            Ref(ref max1, ref min1, ref sum1, ref avg1, arr);

            StringUtil str = new StringUtil();
            StringUtil.Judge();
            ArrayUtil array = new ArrayUtil();
            ArrayUtil.Array();

            MeiJu mj = new MeiJu();
            MeiJu.Text1();
            MeiJu.Text2();
            MeiJu.Text3();

            Teacher tea = new Teacher();
            tea.NameA = "孙悟空";
            tea.NameB = "猪八戒";
            tea.NameC = "沙悟净";
            tea.NameD = "白龙马";
            tea.Test();

            Console.ReadKey();

        }
        public static void Out(out int max, out int min, out int sum, out int avg, int[] arr)
        {
            max = arr[0];
            min = arr[0];
            sum = 0;

            for (int i = 0; i < arr.Length; i++)
            {
                if (max <= arr[i])
                {
                    max = arr[i];
                }

            }
            for (int i = 0; i < arr.Length; i++)
            {
                sum = sum + arr[i];
            }
            avg = sum / arr.Length;
            Console.WriteLine("最大值是{0}，最小值是{1},和为{2}，平均值为{3}", max, min, sum, avg);
        }
        public static void Ref(ref int max1, ref int min1, ref int sum1, ref int avg1, int[] arr)
        {
            max1 = arr[0];
            min1 = arr[0];
            sum1 = 0;
            for (int i = 0; i < arr.Length; i++)
            {
                if (max1 <= arr[i])
                {

                    max1 = arr[i];

                }
            }
            for (int i = 0; i < arr.Length; i++)
            {
                sum1 = sum1 + arr[i];
            }
            avg1 = sum1 / arr.Length;
            Console.WriteLine("最大值是{0}，最小值是{1},和为{2}，平均值为{3}", max1, min1, sum1, avg1);
        
        }
    }
}
